package com.product.config.sa;

import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import com.common.SysSession;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @program: Member_Perks_Store
 * @description:
 * @author: 无恙
 * @create: 2024-06-18 22:22
 **/

@Component
public class StpInterfaceImpl implements StpInterface {

    @Override
    public List<String> getPermissionList(Object o, String s) {
        // 确保对象 o 不为空
        SysSession session = (SysSession)StpUtil.getSession().get("LOGIN_USER");
        return session.getPermissionList();
    }

    @Override
    public List<String> getRoleList(Object o, String s) {
        // 确保对象 o 不为空
        SysSession session = (SysSession)StpUtil.getSession().get("LOGIN_USER");
        return session.getRoleList();
    }
}
